/* CSS变量定义 - 支持深色模式 */
:root {
    /* 浅色模式变量 */
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-heading: #2c3e50;
    --accent-color: #3498db;
    --accent-hover: #2980b9;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);
    --timeline-line: #3498db;
    --timeline-dot: #ffffff;
    --timeline-border: #3498db;
    --skill-proficient: #e8f5e8;
    --skill-advanced: #fff3cd;
    --skill-beginner: #f8d7da;
    --skill-text-proficient: #155724;
    --skill-text-advanced: #856404;
    --skill-text-beginner: #721c24;
}

/* 深色模式变量 */
[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-card: #3a3a3a;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-heading: #ffffff;
    --accent-color: #4a9eff;
    --accent-hover: #357abd;
    --border-color: #404040;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.4);
    --timeline-line: #4a9eff;
    --timeline-dot: #2d2d2d;
    --timeline-border: #4a9eff;
    --skill-proficient: #1a3a1a;
    --skill-advanced: #3a341a;
    --skill-beginner: #3a1a1a;
    --skill-text-proficient: #a8e6a8;
    --skill-text-advanced: #ffd93d;
    --skill-text-beginner: #ff9999;
}

/* 基本重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 全局样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 容器样式 */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-heading);
    transition: color 0.3s ease;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-heading);
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* 段落样式 */
p {
    margin-bottom: 1rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

/* 链接样式 */
a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-hover);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-hover);
}

/* 导航样式 */
header {
    background-color: var(--bg-secondary);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px var(--shadow-color);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-heading);
    transition: color 0.3s ease;
}

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    color: var(--text-heading);
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s ease, background-color 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* 深色模式切换按钮响应式样式 */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 120px;
    margin-left: 0;
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 5px;
}

.theme-switch {
    width: 50px;
    height: 28px;
}

.slider:before {
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.theme-icon {
    font-size: 16px;
}

/* 语言切换按钮样式 */
.language-switcher {
    display: flex;
    gap: 5px;
    margin-left: 20px;
}

.lang-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: var(--bg-card);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.lang-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.hamburger {
    display: none;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-heading);
    margin: 5px 0;
    transition: all 0.3s ease, background-color 0.3s ease;
}

/* 英雄区样式 */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 0 20px;
    margin-top: 70px;
}

.hero-content {
    max-width: 800px;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: white;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    color: white;
}

.highlight {
    color: #f39c12;
}

/* 关于我部分样式 */
.about {
    padding: 80px 0;
    background-color: var(--bg-secondary);
    transition: background-color 0.3s ease;
}

.about-content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: center;
}

.about-image {
    flex: 1;
    min-width: 300px;
}

.about-image img {
    width: 100%;
    border-radius: 50%;
    max-width: 300px;
    margin: 0 auto;
    display: block;
    box-shadow: 0 10px 30px var(--shadow-color);
    transition: box-shadow 0.3s ease;
}

.about-text {
    flex: 2;
    min-width: 300px;
}

.about-text p {
    color: var(--text-primary);
    transition: color 0.3s ease;
}

/* 技能标签样式 */
.skills {
    margin-top: 20px;
}

.skills ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skills li {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.skill-proficient {
    background-color: var(--skill-proficient);
    color: var(--skill-text-proficient);
    border: 1px solid var(--accent-color);
}

.skill-intermediate {
    background-color: var(--skill-advanced);
    color: var(--skill-text-advanced);
    border: 1px solid #f39c12;
}

.skill-beginner {
    background-color: var(--skill-beginner);
    color: var(--skill-text-beginner);
    border: 1px solid #e74c3c;
}

.skill-level {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* 时间线样式 */
.experience {
    margin-top: 30px;
}

.timeline {
    position: relative;
    margin-top: 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--border-color);
    transition: background-color 0.3s ease;
}

.timeline-item {
    position: relative;
    padding-left: 40px;
    margin-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--accent-color);
    border: 3px solid var(--timeline-dot);
    transition: all 0.3s ease;
}

.timeline-date {
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

.timeline-content h4 {
    margin-bottom: 5px;
    color: var(--text-heading);
    transition: color 0.3s ease;
}

.timeline-content p {
    margin-bottom: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

/* 成就部分样式 */
.achievements {
    margin-top: 30px;
}

.achievements ul {
    list-style: none;
}

.achievements li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.achievements li::before {
    content: '🏆';
    position: absolute;
    left: 0;
    top: 2px;
}

/* 项目作品部分样式 */
.projects {
    padding: 80px 0;
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.project-item {
    background-color: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.project-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px var(--shadow-hover);
}

.project-image {
    height: 200px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-item:hover .project-image img {
    transform: scale(1.05);
}

.project-info {
    padding: 20px;
}

.project-info h3 {
    color: var(--text-heading);
    transition: color 0.3s ease;
}

.project-info p {
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.project-link {
    display: inline-block;
    margin-top: 10px;
    font-weight: 500;
    color: var(--accent-color);
    transition: color 0.3s ease;
}

.project-link:hover {
    color: var(--accent-hover);
}

/* 联系我部分样式 */
.contact {
    padding: 80px 0;
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease;
}

.contact .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.contact h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5rem;
    color: var(--text-heading);
    transition: color 0.3s ease;
}

.contact-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 40px;
}

.contact-info {
    flex: 1;
    min-width: 300px;
    background-color: var(--bg-card);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: all 0.3s ease;
}

.contact-info p {
    margin-bottom: 30px;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.contact-info ul {
    margin-bottom: 30px;
    list-style: none;
    padding: 0;
}

.contact-info li {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
}

.contact-info li i {
    margin-right: 10px;
    color: var(--accent-color);
    transition: color 0.3s ease;
}

/* 社交链接样式 */
.social-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.social-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.social-link:hover {
    background-color: var(--accent-color);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--shadow-hover);
}

.social-link i {
    margin-right: 12px;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

/* 简单的图标样式 */
.icon-website::before {
    content: "🌐";
}

.icon-email::before {
    content: "✉️";
}

/* 联系表单样式 */
.contact-form {
    flex: 1;
    min-width: 300px;
    background-color: var(--bg-card);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: all 0.3s ease;
}

/* 表单交互样式增强 */
.form-group {
    position: relative;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

/* 聚焦状态样式 */
.form-group.focused {
    transform: translateY(-3px);
}

.form-group.focused label {
    color: var(--accent-color);
    font-weight: 600;
}

/* 填充状态样式 */
.form-group.filled label {
    color: var(--accent-color);
}

/* 输入框过渡动画 */
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

/* 发送按钮加载状态 */
.contact-form .btn,
.contact-form button[type="submit"] {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
}

.contact-form button[type="submit"]:disabled {
    background-color: var(--text-secondary);
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.contact-form .btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow-hover);
}

.contact-form .btn:active {
    transform: translateY(0);
}

/* 社交链接悬停时的图标缩放效果 */
.social-link:hover i {
    transform: scale(1.2);
    transition: transform 0.3s ease;
}

/* 页脚样式 */
footer {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid var(--border-color);
    transition: all 0.3s ease;
}